package com.sright.bcard.enterprise.dal.dao.impl;

import com.sright.bcard.common.service.share.base.dao.BaseDAOImpl;
import com.sright.bcard.common.service.share.base.dao.BaseMapper;
import com.sright.bcard.common.service.share.dto.page.BetweenDateParamRequest;
import com.sright.bcard.common.service.share.dto.page.PageParamRequest;
import com.sright.bcard.enterprise.dal.dao.EnterpriseDAO;
import com.sright.bcard.enterprise.dal.entity.EnterpriseDO;
import com.sright.bcard.enterprise.dal.entity.ext.EnterpriseExtraDO;
import com.sright.bcard.enterprise.dal.mapper.EnterpriseDOMapper;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

@Repository
public class EnterpriseDAOImpl extends BaseDAOImpl<EnterpriseDO> implements EnterpriseDAO {

    @Resource
    private EnterpriseDOMapper enterpriseDOMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return enterpriseDOMapper.deleteByPrimaryKey(id);
    }

    @Override
    public EnterpriseDO selectByMobile(String mobile) {
        return enterpriseDOMapper.selectByMobile(mobile);
    }

    @Override
    public List<EnterpriseDO> selectByEnterpriseIdList(List<Long> enterpriseIdList) {
        return enterpriseDOMapper.selectByEnterpriseIdList(enterpriseIdList);
    }

    @Override
    public Integer countOfEnterpriseExtra(String keyword, Integer status, BetweenDateParamRequest betweenDateParamRequest, Date currentDate) {
        return enterpriseDOMapper.countOfEnterpriseExtra(keyword, status, betweenDateParamRequest,currentDate);
    }

    @Override
    public List<EnterpriseExtraDO> selectPageOfEnterpriseExtra(String keyword, Integer status, BetweenDateParamRequest betweenDateParamRequest, PageParamRequest pageParamRequest, Date currentDate) {
        return enterpriseDOMapper.selectPageOfEnterpriseExtra(keyword, status, betweenDateParamRequest, pageParamRequest,currentDate);
    }

    @Override
    public List<EnterpriseDO> selectEnterpriseList() {
        return enterpriseDOMapper.selectEnterpriseList();
    }

    @Override
    public List<EnterpriseDO> selectExpireListByDate(Date beginDate, Date endDate) {
        return enterpriseDOMapper.selectExpireListByDate(beginDate,endDate);
    }

    @Override
    public Integer onStatus(EnterpriseDO enterpriseDO) {
        return enterpriseDOMapper.onStatus(enterpriseDO);
    }

    @Override
    public List<EnterpriseDO> selectExpireListByCreateDate(Date beginDate, Date endDate) {
        return enterpriseDOMapper.selectExpireListByCreateDate(beginDate,endDate);
    }

    @Override
    protected BaseMapper<EnterpriseDO> getObjMapper() {
        return enterpriseDOMapper;
    }
}
